package com.cleaningcloud.cld.mapper.mini;


import com.cleaningcloud.cld.domain.CldAttendance;
import com.cleaningcloud.cld.domain.CldPayConfirm;
import com.cleaningcloud.cld.domain.dto.CldPayConfirmDto;
import com.cleaningcloud.cld.domain.dto.CldRestbreaksDto;
import com.cleaningcloud.cld.domain.mini.HolidayData;
import com.cleaningcloud.cld.domain.mini.HolidayDto;
import com.cleaningcloud.cld.domain.vo.CldRestbreaksVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface MiniSalaryMapper {


    /**
     * 查询排休列表
     *
     * @param map
     * @return
     */
    List<HolidayData> selectHolidayList(HolidayDto holidayDto);

    /**
     * 排休明细查看
     *
     * @param cldRestbreaksDto
     * @return
     */
    List<CldRestbreaksVo> getScheduleDetails(CldRestbreaksDto cldRestbreaksDto);


    /**
     * 每日薪酬查看
     *
     * @param cldPayConfirm
     * @return
     */
    Map<String, Object> selectDailySalary(CldPayConfirm cldPayConfirm);

    /**
     * 查看薪酬列表
     *
     * @param cldPayConfirm
     * @return
     */
    List<Map<String, Object>> selectSalaryList(CldPayConfirmDto cldPayConfirm);


    /**
     * 薪酬明细
     *
     * @param cldPayConfirm
     * @return
     */
    List<Map<String, Object>> selectSalaryDetails(CldPayConfirm cldPayConfirm);

    /**
     * 查看出勤人员
     *
     * @param cldAttendance
     * @return
     */
    List<Map<String, Object>> selectAttStaff(CldAttendance cldAttendance);

    /**
     * 批量修改当前日期出未出勤
     *
     * @param projectId
     * @param attendanceDate
     * @return
     */
    @Update("update cld_attendance set is_display = 0 where project_id = #{projectId} and date_format( attendance_date,'%Y%m%d') = date_format(#{attendanceDate},'%Y%m%d') ")
    int batchUpdateAttStaff(@Param("projectId") Long projectId, @Param("attendanceDate") Date attendanceDate);

    /**
     * 批量设置出勤人员
     *
     * @param list
     */
    void batchSetAttStaff(@Param("list") List<Long> list);
}
